package com.neudu.glsb.controller;

import com.neudu.glsb.mapper.EmployeeAttendanceMapper;
import com.neudu.glsb.mapper.OrdersMapper;
import com.neudu.glsb.mapper.SalesRecordsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class AnalyticsController {
    @Autowired
    private OrdersMapper ordersMapper;

    @Autowired
    private EmployeeAttendanceMapper employeeAttendanceMapper;

    // 修改方法名，从销售记录改为订单相关
    @GetMapping("/daily-orders-amount")
    public List<Map<String, Object>> getDailyOrdersAmount() {
        return ordersMapper.getDailyOrdersAmount();
    }

    @GetMapping("/monthly-orders-amount")
    public List<Map<String, Object>> getMonthlyOrdersAmount() {
        return ordersMapper.getMonthlyOrdersAmount();
    }
    @GetMapping("/daily-attendance-rate")
    public List<Map<String, Object>> getDailyAttendanceRate() {
        return employeeAttendanceMapper.getDailyAttendanceRate();
    }
}